<?php

/**
 * Main configuration.
 * All properties can be overridden in mode_<mode>.php files
 */
 
$less = array(
	'class'=>'Less',
	'touchPaths'=>array('assets'),
	'paths'=>array(
		"assets/less/typography.less"=>"assets/css/typography.css",
		"assets/less/form.less"=>"assets/css/form.css",
		
		"assets/camera/less/main.less"=>"assets/camera/css/main.css",
	),
);
 
return array(
    'yiiPath'=>'/Websites/Yii/framework/yii.php',
    'yiicPath'=>'/Websites/Yii/framework/yiic.php',
    'yiitPath'=>'/Websites/Yii/framework/yiit.php',
	'yiiDebug'=>true,
	'yiiTraceLevel'=>0,
	'yiiSetPathOfAlias'=>array(),
	'configWeb'=>array(
		'basePath'=>dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
		'name'=>'Senkom Mitra Polri',
		'theme'=>'coolblack',
		'preload'=>array('log', 'less'),
		'language'=>'en',
		'import'=>array(
			'application.models.*',
			'application.components.*',
			'application.extensions.*',
			'application.behaviors.*',
			'application.widgets.*',
		),
		'defaultController'=>'news',
		'behaviors'=>array(
			'layout'=>'application.behaviors.LayoutBehavior',
		),
		'components'=>array(
			'user'=>array(
				// enable cookie-based authentication
				'allowAutoLogin'=>true,
				'class'=>'WebUser',
			),
			'authManager'=>array(
				'class'=>'CDbAuthManager',
				'connectionID'=>'db',
			),
			'browser'=>array(
				'class'=>'application.components.CBrowser',
			),
			'urlManager'=>array(
				'urlFormat'=>'path',
				'showScriptName'=>false,
				'urlSuffix'=>'.html',
				'rules'=>array(
					array(
						'api/index',
						'pattern'=>'api/<model:\w+>',
						'verb'=>'GET',
					),
					array(
						'api/view',
						'pattern'=>'api/<model:\w+>/<id:.*>',
						'verb'=>'GET'
					),
					array(
						'api/create',
						'pattern'=>'api/<model:\w+>',
						'verb'=>'POST'
					),
					array(
						'gallery/view',
						'pattern'=>'gallery/<path:.*\..*>',
						'verb'=>'GET',
					),
					array(
						'news/monitor',
						'defaultParams'=>array('theme'=>'monitor1360x768'),
						'pattern'=>'pemantauan/wide',
						'parsingOnly'=>true,
					),
					array(
						'news/monitor',
						'pattern'=>'pemantauan',
						'parsingOnly'=>true,
					),
					array(
						'news/monitoring',
						'pattern'=>'informasi',
						'parsingOnly'=>true,
					),
					array(
						'city/list',
						'pattern'=>'alamat',
						'parsingOnly'=>true,
					),
					array(
						'news/download',
						'pattern'=>'laporan',
						'parsingOnly'=>true,
					),
					array(
						'registration/default',
						'pattern'=>'munas',
						'parsingOnly'=>true,
					),
					array(
						'printing',
						'pattern'=>'kta',
						'parsingOnly'=>true,
					),
					'<controller:\w+>/<id:\d+>'=>'<controller>/view',
					'<controller:\w+>/<action:\w+>/<id:\d+>'=>
					'<controller>/<action>',
					'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
				),
			),
			// Database
			'db'=>array(
				'connectionString'=>'', //override in config/mode_<mode>.php
				'emulatePrepare'=>true,
				'username'=>'', //override in config/mode_<mode>.php
				'password'=>'', //override in config/mode_<mode>.php
				'charset'=>'utf8',
			),
			// Error handler
			'errorHandler'=>array(
				// use 'site/error' action to display errors
				'errorAction'=>'site/error',
			),
			'mail'=>array(
				'class'=>'application.components.CMail',
				'transportType'=>'smtp', /// case sensitive!
				'transportOptions'=>array(
					'host'=>'smtp.gmail.com',
					'username'=>'berita@senkom.or.id',
					'password'=>'beritasic',
					'port'=>'465',
					'encryption'=>'ssl',
				),
				'logging'=>true,
				'dryRun'=>false
			),
			'less'=>$less,
		),
	),
	// This is the Console application configuration. Any writable
	// CConsoleApplication properties can be configured here.
	// Leave array empty if not used.
	// Use value 'inherit' to copy from generated configWeb.
	'configConsole'=>array(
		'basePath'=>dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
		'name'=>'Ayamo',
		// Preloading 'log' component
		'preload'=>array('log'),
		// Autoloading model and component classes
		'import'=>'inherit',
		// Application componentshome
		'components'=>array(
			// Database
			'db'=>'inherit',
			'authManager'=>array(
				'class'=>'CDbAuthManager',
				'connectionID'=>'db',
			),
			// Application Log
			'log'=>array(
				'class'=>'CLogRouter',
				'routes'=>array(
					// Save log messages on file
					array(
						'class'=>'CFileLogRoute',
						'levels'=>'error, warning, trace, info',
					),
				),
			),
			'mail'=>'inherit',
		),
	),
);